package com.liang.jiekou.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.liang.jiekou.entity.INVMB;
import com.liang.jiekou.entity.Result;
import com.liang.jiekou.entity.result.COPTCD;
import com.liang.jiekou.entity.result.PURTCD;
import com.liang.jiekou.service.COPTCDService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Api(tags = "销售（客户）订单控制器")
@RestController
@RequestMapping("/xs")
public class COPTCDController {
@Resource
private COPTCDService coptcdService;

    @ApiOperation("根据单别单号查询销售单信息")
    //查询采购单信息
    @GetMapping("/selectCOPTCD")
    public COPTCD selectCOPTCD(@RequestParam String TC001, @RequestParam String TC002){
        return   coptcdService.selectCOPTCD(TC001, TC002);
    }


    /*@ApiOperation("查询全部销售单信息")
    @GetMapping("/selectCOPTCD/all")
    public Result<IPage<COPTCD>> selectINVMBall(@RequestParam Integer page, @RequestParam Integer pageSize,
                                                                     String startcreate, String endcreate, String startupdate, String endupdate
    ){
        Page<COPTCD> paging = new Page<>(page, pageSize);

        IPage<COPTCD> coptcdIPage = coptcdService.selectCOPTCDall(paging,startcreate,endcreate,startupdate,endupdate);

        return Result.success(coptcdIPage );

    }*/

    @ApiOperation("查询全部销售单信息")
    @GetMapping("/selectCOPTCD/all")
    public Result<Page<COPTCD>> selectINVMBall(@RequestParam Integer page, @RequestParam Integer pageSize,
                                                String startcreate, String endcreate, String startupdate, String endupdate
    ){


        Page<COPTCD> coptcdPage = coptcdService.selectCoptcdPage(page, pageSize,startcreate,endcreate,startupdate,endupdate);
        return Result.success(coptcdPage);

    }
}
